import Vue from 'vue'
import Vuex from 'vuex'
import module_user from '@/store/module_user.js'
import module_cart from '@/store/module_cart.js'
Vue.use(Vuex)

const store = new Vuex.Store({
	state: () => ({
		nowPay: false,
		cartPay: false,
		nowPayGoods: {}
	}),
	modules: {
		module_user,
		module_cart
	},
	mutations: {
		updateNowPay(state) {
			state.nowPay = true
			state.cartPay = false
		},
		updateCartPay(state) {
			state.nowPay = false
			state.cartPay = true
		},
		updateNowPayGoods(state, goods) {
			console.log(goods);
			state.nowPayGoods = goods
		}
	}
})

export default store